<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .container {
            max-width: 1200px;
            margin: auto;
            line-height: 50px;
        }

        header .container {
            display: flex;
            justify-content: space-between;
        }

        header ul {
            display: flex;
        }

        header ul li {
            margin-right: 30px;
        }


        @media screen and (max-width:768px) {
            header ul {
                position: fixed;
                width: 100%;
                background-color: #000;
                color: #fff;
                top: 50px;
                /* flex-direction: column; */
                display: block;

                height: 0;
                overflow: hidden;
                transition: .3s;
            }

            header label {
                width: 30px;
                height: 30px;
                background-color: #f00;
            }

            header input:checked ~ ul {
                height: 300px;
            }
        }
    </style>
</head>

<body>

    <!-- 

        PC端导航正常写

        手机上  导航变成了定位

     -->

    <header>
        <div class="container">
            <h1>logo</h1>

            <input type="checkbox" name="" id="a" hidden>
            <label for="a"></label>
            <ul>
                <li>
                    <a href="">home</a>
                </li>
                <li>
                    <a href="">home</a>
                </li>
                <li>
                    <a href="">home</a>
                </li>
                <li>
                    <a href="">home</a>
                </li>
                <li>
                    <a href="">home</a>
                </li>

            </ul>
        </div>
    </header>

</body>

</html>